package com.huazi.eduservice.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.util.Date;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author huazi
 * @since 2021-03-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="EduCourse对象", description="")
public class EduCourse implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id",type = IdType.ID_WORKER_STR)
    @ApiModelProperty(value = "课程id")
    private String id;

    @ApiModelProperty(value = "讲师id",example ="0")
    private Integer teacherId;

    @ApiModelProperty(value = "课目id")
    private String subjectId;

    @ApiModelProperty(value = "课程父id")
    private String subjectParentId;

    @ApiModelProperty(value = "课程名称")
    private String title;

    @ApiModelProperty(value = "简介信息")
    private String description;

    @ApiModelProperty(value = "课程价格",example ="0")
    private BigDecimal price;

    @ApiModelProperty(value = "总课时",example ="0")
    private Integer lessonNum;

    @ApiModelProperty(value = "封面图片路径")
    private String cover;

    @ApiModelProperty(value = "购买数量",example ="0")
    private Integer buyCount;

    @ApiModelProperty(value = "浏览次数",example ="0")
    private Integer viewCount;

    //声明乐观锁需要创建一个实例
    @Version
    @ApiModelProperty(value = "乐观锁(版本)",example = "1")
    private Integer version;

    @ApiModelProperty(value = "课程状态 Draft未发布 Normal已发布")
    private String status;

    @TableLogic
    @ApiModelProperty(value = "逻辑删除 1(true) 已删除 0 (false) 未删除",example = "0")
    private Integer isDeleted;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private Date gmtCreate;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间")
    private Date gmtModified;
}
